# coding=utf-8

from traverse.common.utils import FileUtil

'''
应用页面爬虫,配置文件域
'''

class CrawlerConf(object):
    
    def __init__(self, conf):
        self.parse(conf)
        
    def parse(self, conf):
        self.conf = FileUtil.load_conf(conf)
        self.logLevel = self.conf.get('logLevel') or "TRACE"
        self.traversalType = 0 or self.conf.get('traversalType')
        self.screenShot = self.conf.get('ScreenShot')
        self.reportTitle = ""
        self.screenshotTimeout = 20 or self.conf.get('screenshotTimeout')
        self.tagLimitMax = 3 or self.conf.get('tagLimitMax')
        self.maxTime = 10800 or self.conf.get('maxTime')
        self.maxDeepth =  800 or self.conf.get('maxDeepth')
        self.app = self.conf.get('app') # app
        self.selectedList = self.conf.get('selectedList')
        self.report_dir = self.conf.get('reportDir')
        self.max_click_num = self.conf.get('maxClickNum')
        self.urlBlackList = self.conf.get('urlBlackList')
        self.blackElementList = self.conf.get('blackElementList')
        self.crash_attach_file = self.conf.get('crashAttachFile')
        self.urlPageBlackList = self.conf.get('urlPageBlackList')
        self.startup_guide = self.conf.get('startup_guide')
        self.trigger_action = self.conf.get('trigger_action')
        self.back_action = self.conf.get('back_action')
        self.priorityClickElement = self.conf.get('priorityClickElement')